package com.meilai.project.mapper.business.installOrder;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.meilai.project.dto.business.installOrder.WorkerDTO;
import com.meilai.project.entity.business.installOrder.WorkOrderInstallDetailWorker;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WorkOrderInstallDetailWorkerMapper extends BaseMapper<WorkOrderInstallDetailWorker> {

    @Select("select  a.`worker_id` as id,a.`building_area_id` as building_area_id,u.`name` as name from `work_order_install_detail_worker` a left join `user` u on a.`worker_id`=u.`id` where ISNULL(a.`deleted_at`) and a.`work_order_id`=#{work_order_id}")
    List<WorkerDTO> listWorkOrderBuildingWorkByWorkOrderId(Long id);

    @Select("select * from work_order_install_detail_worker where work_order_id = #{workOrderId} ")
    List<WorkOrderInstallDetailWorker> listByWorkOrderId(@Param("workOrderId") Long workOrderId);

}
